package com.dahong.cloud;

import com.lambda.cloud.redis.delay.RedisDelayedQueueManager;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
import java.util.concurrent.TimeUnit;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;

@SpringBootApplication
public class AuthorizeApplication {

    @SuppressFBWarnings("ST_WRITE_TO_STATIC_FROM_INSTANCE_METHOD")
    private static RedisDelayedQueueManager<String> redisDelayedQueueManager;

    @Autowired
    public void setRedisDelayedQueueManager(RedisDelayedQueueManager<String> redisDelayedQueueManager) {
        AuthorizeApplication.redisDelayedQueueManager = redisDelayedQueueManager;
    }

    public static void main(String[] args) {
        SpringApplication.run(AuthorizeApplication.class, args);
        System.out.println("项目启动成功！");
        redisDelayedQueueManager.offer("延迟15秒笑一下", 15, TimeUnit.SECONDS);
    }
}
